<?php

namespace App\Models\GameServer;

use Illuminate\Database\Eloquent\Model;

class Gift extends Model
{
    protected $table = 'gift_mall_config';
    protected $primaryKey = 'id';
    protected $connection = 'game_server';

    protected $fillable = [
        'item_name', 'price','icon','kind','recommand','addr','over_time','note','max_num','sale_num','enable','order_id'
    ];

    //剩余数量
    public function getLaveNumattribute()
    {
        return $this->attributes['max_num'] - $this->attributes['sale_num'];
    }
}
